package com.huibei.wateradmin.merchant.message;


import java.text.DecimalFormat;

/**
 * Created by dfs on 2017/8/29.
 */
public class ShopBasicInfoModel {
    Long shopId;

    Long score;

    Long saleMount;

    String imageUrl;

    String name;

    String address;

    String distance;

    Long deliveryTime;

    Long totalProductCount;

    String shareUrl;

    boolean collectFlg;

    Long fansCount=0L;

    Boolean certification;

    public ShopBasicInfoModel() {
    }

    public ShopBasicInfoModel(Long shopId, Long score, Long saleMount, String imageUrl, String name,
                              String address, Double distance, Long deliveryTime,
                              Long totalProductCount, String shareUrl, boolean collectFlg, Long fansCount, Boolean certification) {
        this.shopId = shopId;
        this.score = score;
        this.saleMount = saleMount;
        this.imageUrl = imageUrl;
        this.name = name;
        this.address = address;
        this.distance = formatDistance(distance);
        this.deliveryTime = deliveryTime;
        this.totalProductCount = totalProductCount;
        this.shareUrl = shareUrl;
        this.collectFlg = collectFlg;
        this.fansCount = fansCount;
        this.certification = certification;
    }

    String formatDistance(Double distance) {
        DecimalFormat decimalFormat = new DecimalFormat("0.00");
        return decimalFormat.format(distance) + "km";
    }

    public Long getShopId() {
        return shopId;
    }

    public Long getScore() {
        return score;
    }

    public Long getSaleMount() {
        return saleMount;
    }

    public String getImageUrl() {
        return imageUrl;
    }

    public String getName() {
        return name;
    }

    public String getAddress() {
        return address;
    }

    public String getDistance() {
        return distance;
    }

    public Long getDeliveryTime() {
        return deliveryTime;
    }

    public Long getTotalProductCount() {
        return totalProductCount;
    }

    public String getShareUrl() {
        return shareUrl;
    }

    public boolean isCollectFlg() {
        return collectFlg;
    }

    public Long getFansCount() {
        return fansCount;
    }

    public Boolean getCertification() {
        return certification;
    }
}
